import request from '@/utils/request'

export function getPlanList(query) {
    return request({
        url: '/purchase/purchasePlan/list',
        method: 'get',
        params: query
    })
}

//获得预算编号id
export function getBudgetCode() {
    return request({
        url: '/purchase/purchasePlan/getBudgetCode',
        method: 'get'
    })
}


//查询物料列表
export function getProductList(query) {
    return request({
        url: '/purchase/product/productList',
        method: 'get',
        params: query
    })
}

//采购计划附件上传
export function uplodaBudgetFile(data) {
    return request({
        url: '/file/upload',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data',
        }
    })
}


//新增采购计划
export function addPurchasePlan(formPlan) {
    return request({
        url: '/purchase/purchasePlan/addPurchasePlan',
        method: 'post',
        data: formPlan
    })
}

//跟进采购计化编码查询信息
export function getPurchasePlanByACode(aCode) {
    return request({
        url: '/purchase/purchasePlan/getPurchasePlanByACode/' + aCode,
        method: 'get'
    })
}


//根据采购状态
export function getPlanByState(aCode) {
    return request({
        url: '/purchase/purchasePlan/getPlanByState/' + aCode,
        method: 'get'
    })
}


//编辑采购计划
export function editPlan(plan) {
    return request({
        url: '/purchase/purchasePlan/editPlan',
        method: 'post',
        data: plan
    })
}



//删除行项目
export function deleteDevice(vCode) {
    return request({
        url: '/purchase/purchasePlan/deleteDevice/' + vCode,
        method: 'DELETE'
    })
}


//删除文件
export function removeFile(name) {
    return request({
        url: '/purchase/pubAttachments/removeFile/' + name,
        method: 'DELETE'
    })
}



//跟进aCode更改astate
export function changeAstateByACode(form) {
    return request({
        url: '/purchase/purchasePlan/changeAstateByACode',
        method: 'PUT',
        data: form
    })
}

//跟进aCode更改astate
export function changeAstateByACodeAdmin(form) {
    return request({
        url: '/purchase/purchasePlan/changeAstateByACodeAdmin',
        method: 'PUT',
        data: form
    })
}




//框架计划
export function getFrameworkPlan(form) {
    return request({
        url: '/purchase/frameworkPlan/getFrameworkPlan',
        method: 'get',
        params: form
    })
}


//跟进框架计划编码查询详细信息
export function getFrameworkPlanDetails(planCode) {
    return request({
        url: '/purchase/frameworkPlan/getFrameworkPlanDetails/' + planCode,
        method: 'get'
    })
}


//新增采购计划框架
export function submitFrameworkPlan(form) {
    return request({
        url: '/purchase/frameworkPlan/addFrameworkPlan',
        method: 'POST',
        data: form
    })
}



//根据planCode获得框架计划
export function getFramePlanByPlanCode(planCode) {
    return request({
        url: '/purchase/frameworkPlan/getFramePlanByPlanCode/' + planCode,
        method: 'GET'
    })
}

/**
 * 编辑框架计划
 * @param {*} form 
 * @returns 
 */
export function editFramePlan(form) {
    return request({
        url: '/purchase/frameworkPlan/editFramePlan',
        method: 'PUT',
        data: form
    })
}
/**
 * 跟进物料类别获得名称
 */
export function getCSType() {
    return request({
        url: '/purchase/frameworkPlan/getCSType',
        method: 'GET'
    })
}


// 更改采购框架状态(提交)
export function upSubmitFrameworkPlan(planCode) {
    return request({
        url: '/purchase/frameworkPlan/updateStatusByCode/' + planCode,
        method: 'PUT'
    })
}

// 删除框架计划
export function deleteFrameworkPlan(planCode) {
    return request({
        url: '/purchase/frameworkPlan/deleteFrameworkPlan/' + planCode,
        method: 'DELETE'
    })
}


// 更改采购框架状态(审核)
export function allowFarmeworkPlan(planCode) {
    return request({
        url: '/purchase/frameworkPlan/allowFrameworkPlan/' + planCode,
        method: 'PUT'
    })
}


// 更改采购框架状态(驳回)
export function rejectFarmeworkPlanWay(planCode) {
    return request({
        url: '/purchase/frameworkPlan/rejectFrameworkPlan/' + planCode,
        method: 'PUT'
    })
}



// 获得供应商列表
export function getSupplierList() {
    return request({
        url: '/supplier/supplier/getSupplierList',
        method: 'GET',
        // params:data
    })
}

// 获得供应商列表分页版
export function getSupplierListPage(data) {
    return request({
        url: '/supplier/supplier/getSupplierListPage',
        method: 'GET',
        params:data
    })
}


// 确认项目采购寻源
export function submitSourcing(data) {
    return request({
        url: '/purchase/purchasePlan/submitSourcing',
        method: 'PUT',
        data: data
    })
}
// 优先展示未寻源项目
export function getNotSourcing(data) {
    return request({
        url: '/purchase/purchasePlan/getNotSourcing',
        method: 'GET',
        data: data
    })
}

//查询招标项目列表
export function getTenderProjectList(data) {
    return request({
        url: '/purchase/tender/list',
        method: 'GET',
        params: data
    })
}

//查找或编辑项目的详细信息(项目状态在1时)
export function getTenderProjectInfo(data) {
    return request({
        url: '/purchase/tender/getTenderProjectInfo/' + data,
        method: 'GET'
    })
}

//编辑招标项目
export function updateTenderProject(data) {
    return request({
        url: '/purchase/tender/updateTenderProject',
        method: 'PUT',
        data: data
    })
}

// //邀请招标商
// export function  getProjectStateAndStartTime(iNumber) {
//     return request({
//         url: '/purchase/tender/getProjectStateAndStartTime/'+iNumber,
//         method: 'POST'
//    })
// }



//删除招标项目
export function deleteTenderProject(iNumber) {
    return request({
        url: '/purchase/tender/deleteTenderProject/' + iNumber,
        method: 'DELETE'
    })
}


//更新招标项目并更改招标项目的状态
export function changeTenderProjectStatus(data) {
    return request({
        url: '/purchase/tender/changeTenderProjectStatus',
        method: 'PUT',
        data: data
    })
}



//更新招标项目并更改招标项目的状态
export function getNoiceList(data) {
    return request({
        url: '/purchase/tender/getTenderNoticeByINumber/' + data,
        method: 'GET'
    })
}


// 新增项目公告
export function addTenderNotice(data) {
    return request({
        url: '/purchase/tender/addTenderNotice',
        method: 'POST',
        data: data
    })
}


// 获得详细项目公告
export function getNoticeInfoByUId(uId) {
    return request({
        url: '/purchase/tender/getNoticeInfoByUId/' + uId,
        method: 'GET',
    })
}


// 提交详细项目公告
export function submitTenderNotice(data) {
    return request({
        url: '/purchase/tender/submitTenderNotice',
        method: 'PUT',
        data: data
    })
}

// 编辑招标公告
export function editTenderNotice(data) {
    return request({
        url: '/purchase/tender/editTenderNotice',
        method: 'PUT',
        data: data
    })
}

// 审核招标公告
export function examineNoticeRow(data) {
    return request({
        url: '/purchase/tender/examineNoticeRow',
        method: 'PUT',
        data: data
    })
}

// 发布招标公告
export function releaseNoticeRow(data) {
    return request({
        url: '/purchase/tender/releaseNoticeRow/' + data,
        method: 'PUT',
    })
}


// 删除招标公告
export function deleteNoticeRow(data) {
    return request({
        url: '/purchase/tender/deleteNoticeRow/' + data,
        method: 'DELETE',
    })
}

// 删除招标公告
export function getFileListByINumber(data) {
    return request({
        url: '/purchase/tender/getFileListByINumber/' + data,
        method: 'GET',
    })
}


// 驳回招标公告
export function rejectNotice(data) {
    return request({
        url: '/purchase/tender/rejectNotice/' + data,
        method: 'PUT'
    })
}

// 添加招标文件
export function addTenderFile(data) {
    return request({
        url: '/purchase/tender/addTenderFile',
        method: 'POST',
        data: data
    })
}


// 删除招标文件
export function deleteTenderFile(data) {
    return request({
        url: '/purchase/tender/deleteTenderFile/' + data,
        method: 'DELETE'
    })
}


// 投标页面的获取标书界面
export function bidGetDocumentPeople(data) {
    return request({
        url: '/purchase/tender/bidGetDocumentPeople/' + data,
        method: 'GET'
    })
}



// 投标页面的投递标书界面
export function getBidPeopleList(data) {
    return request({
        url: '/purchase/tender/getBidPeopleList/' + data,
        method: 'GET'
    })
}


// 投标 获得项目详细
export function getTender(data) {
    return request({
        url: '/purchase/tender/getTender/' + data,
        method: 'GET'
    })
}


// 获得专家(关联学历)
export function getDialogExpertData(data) {
    return request({
        url: '/expert/expertC/getDialogExpertData',
        method: 'GET',
        params: data
    })
}


// 添加专家抽取
export function addApplications(data) {
    return request({
        url: '/purchase/applications/addApplications',
        method: 'POST',
        data: data
    })
}


// 专家委员会
export function committeeList(data) {
    return request({
        url: '/purchase/applications/committeeList',
        method: 'GET',
        params: data
    })
}
//删除专家委员会中一个专家
export function  deleteCommittee(jId) {
    return request({
        url: '/purchase/applications/deleteCommittee/'+jId,
        method: 'DELETE'
   })
}


//开标是否开始
export function getProjectStateAndStartTime(iNumber) {
    return request({
        url: '/purchase/tender/getProjectStateAndStartTime/'+iNumber,
        method: 'GET'
   })
}


//获得所有投标商
export function getALlSupplierList(data) {
    return request({
        url: '/purchase/tender/getAllSupplierList',
        method: 'GET',
        params:data
   })
}


//获得所有投标商
export function getAllBidder(data) {
    return request({
        url: '/purchase/tender/getAllBidder/'+data,
        method: 'GET',
    })
}

//添加中标候选人
export function addCandidate(data) {
    return request({
        url: '/purchase/tender/addCandidate',
        method: 'POST',
        data:data
    })
}

//供应商获得标书
export function getBidDocument(iNumber) {
    return request({
        url: '/purchase/tender/getBidDocument/'+iNumber,
        method: 'POST'
    })
}

//供应商投递标书
export function csSubmission(data) {
    return request({
        url: '/purchase/tender/addSubmission',
        method: 'POST',
        data:data
    })
}


//获取中标候选人
export function getBidWinningCandidate(data) {
    return request({
        url: '/purchase/tender/getBidWinningCandidate/'+data,
        method: 'GET',
    })
}


//设置候选人公示时间
export function setStartTenderTime(data) {
    return request({
        url: '/purchase/tender/setStartTenderTime',
        method: 'PUT',
        data:data
    })
}



//确认中标人
export function confirmWinningBidder(data) {
    return request({
        url: '/purchase/tender/confirmWinningBidder',
        method: 'PUT',
        data:data
    })
}


//获得发送通知的供应商
export function getBidWinningCandidateAndSended(data) {
    return request({
        url: '/purchase/tender/getBidWinningCandidateAndSended/'+data,
        method: 'GET'
    })
}

export function getBidCandidateAndSended() {
    return request({
        url: '/purchase/supplierTender/getBidCandidateAndSended',
        method: 'GET'
    })
}

//发送通知给供应商
export function setNoticeToSupplier(data) {
    return request({
        url: '/purchase/tender/setNoticeToSupplier',
        method: 'POST',
        data:data
    })
}

//修改预算
export function editBudgetForm(formData) {
    return request({
        url: '/purchase/purchasePlan/editBudgetForm',
        method: 'PUT',
        data:formData
    })
}


//删除预算
export function deleteBudgetForm(duId) {
    return request({
        url: '/purchase/purchasePlan/deleteBudgetForm/'+duId,
        method: 'DELETE'
   })
}

//获取评标时间
export function getStartTimeAndEndTime(iNumber) {
    return request({
        url: '/purchase/applications/getStartTimeAndEndTime/'+iNumber,
        method: 'GET'
   })
}

//页面单独开一个方法,用于获得所有时间和项目状态
export function getTenderStatusTime(iNumber) {
    return request({
        url: '/purchase/tender/getTenderStatusTime/'+iNumber,
        method: 'GET'
   })
}

//页面单独开一个方法,用于获得所有时间和项目状态
export function getBidingResult() {
    return request({
        url: '/purchase/tender/getBidingResult',
        method: 'GET'
   })
}


//获得供应商登录信息(不同于若依自带的获取用户信息)
export function getPersonInfo() {
    return request({
        url: '/purchase/tender/getPersonInfo',
        method: 'GET'
   })
}

//获得登录页的公告
export function getLoginTenderInfo() {
    return request({
        url: '/purchase/tender/getLoginTenderInfo',
        method: 'GET'
   })
}


//获得登录页的招标公告详细内容
export function getTenderNoticeInfo(data) {
    return request({
        url: '/purchase/tender/getTenderNoticeInfo/' + data,
        method: 'GET'
   })
}

//获得登录页的招标公告中的中标
export function getWinnResult(data) {
    return request({
        url: '/purchase/tender/getWinnResult/' + data,
        method: 'GET'
   })
}

//合同中的物品
export function getLineItemsList(data) {
    return request({
        url: '/purchase/purchasePlan/getLineItemsList/' + data,
        method: 'GET'
   })
}

//供应商获得未中标的
export function getNoBidingResult() {
    return request({
        url: '/purchase/tender/getNoBidingResult',
        method: 'GET'
   })
}


//分类
export function getCategory() {
    return request({
        url: '/purchase/tender/getCategory',
        method: 'GET'
   })
}


